<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>宝贝投-P2P平台->运营后台</title>
<link rel="shortcut icon" href="../favicon.ico" />
<link rel="stylesheet" href="../js/bootstrap-3.3.2-dist/css/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="../css/core.css" type="text/css" />
<link type="text/css" rel="stylesheet" href="../css/account.css" />
<script type="text/javascript" src="../js/jquery/jquery-2.1.3.js"></script>
<script type="text/javascript" src="../js/bootstrap-3.3.2-dist/js/bootstrap.js"></script>
<script type="text/javascript" src="../js/jquery.bootstrap.js"></script>
<script type="text/javascript" src="../js/plugins/jquery.form.js"></script>
<style type="text/css">
body{
	background-color:  #eee;
}
.cm-container{
	margin-top: 160px;
}
.login {
	width: 360px;
	height: 300px;
	margin: 0px auto;
}
</style>
</head>
<body>
	<div class="container cm-container">
		<h3 class="text-center">宝贝投-P2P平台-运营后台</h3>
		<hr />
		<div class="login">
			<form id="loginForm" action="http://localhost:8080/user/login" method="post">
				<div class="form-group form-group-lg">
					<div class="input-group">
						<div class="input-group-addon">用户名</div>
						<input class="form-control" name="username" value="admin"/>
					</div>
				</div>
				<div class="form-group form-group-lg">
					<div class="input-group">
						<div class="input-group-addon">密&emsp;码</div>
						<input class="form-control" name="password" type="password" value="admin"/>
					</div>
				</div>
				<div class="form-group">
					<input type="hidden" name="accountType" value="2" />
					<button class="btn btn-lg btn-primary btn-block">登录</button>
				</div>
			</form>
		</div>
	</div>
</body>
<script type="text/javascript">
    $(function(){
        // '登录表单'提交
        $("#loginForm").ajaxForm({
            success:function(result){

                // 如果返回的数据的响应码不是'成功(200)'
                if(result.code != 200) {
                    $.messager.alert(result.msg);
                    return;
                }

                // 如果返回的数据响应码为200
                // 将账户信息存入到客户端session中，并跳转到后台首页
                sessionStorage.setItem( "admin", JSON.stringify(result.data) );
				 window.location.href="main.html";

            }// success(result);
        });

    });// $(function(){});
</script>
</html>